//
//  GNS_SceneMgr.h
//  MobileManage
//
//  Created by mr.l on 16/1/25.
//
//

#ifndef __MobileManage__GNS_SceneMgr__
#define __MobileManage__GNS_SceneMgr__
#include "cocos2d.h"
#include "Enum.h"
#include "TSingleton.h"
#include "GNS_Common.h"
USING_NS_CC;

enum ENUM_Scene
{
	SCENE_LOGIN,
	SCENE_HALL,
};
enum ENUM_Layer
{
	LAYER_LOGIN,
	LAYER_HALL,
};

class GNS_SceneMgr : public TSingleton<GNS_SceneMgr>
{
public:
    // Here's a difference. Method 'init' in cocos2d-x returns bool, instead of returning 'id' in cocos2d-iphone
public:
	Scene * replaceScene(ENUM_Scene sceneVal);
	Scene * getScene(ENUM_Scene sceneVal){ return _mapScene.at(sceneVal); }
	Layer  * AddSceneLayer(ENUM_Layer layerVal);
	Layer  * getSceneLayer(ENUM_Layer layerVal){ return _mapLayer.at(layerVal); }
private:
    Scene * _curScene = nullptr;
    Layer * _curLayer = nullptr;
    Map<int, Scene*> _mapScene;
    Map<int, Layer*> _mapLayer;
};
#endif /* defined(__MobileManage__GNS_SceneMgr__) */